package cn.imvc.app.domains;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

//显示类型：
//H5：101轮播图、102商品分类、103广告、104双列类型列表、105单列类型列表、106热门搜索
//PC:201：轮播图;202:广告;203:转盘图;204:分类品牌列表；205:三列表 、206:热门搜索
public enum ShowType {
    Scroll(101) {
        public String toString() {
            return "轮播图";
        }
    },
    GoodsClass(102) {
        public String toString() {
            return "商品分类";
        }
    },
    AdList(103) {
        public String toString() {
            return "广告";
        }
    },
    DoubleColType(104) {
        public String toString() {
            return "双列类型列表";
        }
    },
    ColType(105) {
        public String toString() { 
        	return "单列类型列表"; 
        }
    },
    HotSearch(106) {
        public String toString() { 
        	return "热门搜索"; 
        }
    },
	Scrolls(201) {
	        public String toString() {
	            return "轮播图";
	        }
	    },
	AD(202) {
	        public String toString() {
	            return "广告";
	        }
	    },
	Dial(203) {
	        public String toString() {
	            return "转盘图";
	        }
	    },
	CBlist(204) {
	        public String toString() {
	            return "分类品牌列表";
	        }
	    },
	ThreeList(205) {
	        public String toString() { 
	        	return "三列表"; 
	        }
	    },
	 HotSC(206) {
	        public String toString() { 
	        	return "热门搜索"; 
	        }
	    };
    private final int val;

    ShowType(int n) {
        val = n;
    }

    public int getValue() {
        return val;
    }
    public static ShowType getByIntValue(int n) {
        switch (n) {
            case 101:
                return Scroll;
            case 102:
                return GoodsClass;
            case 103:
                return AdList;
            case 104:
                return DoubleColType;
            case 105:
                return ColType;
            case 106:
                return HotSearch;
            case 201:
                return Scrolls;
            case 202:
                return AD;
            case 203:
                return Dial;
            case 204:
                return CBlist;
            case 205:
                return ThreeList;
            case 206:
                return HotSC;
            default:
                return null;
        }
    }
    
    public static final Map<Integer, String> elMap = new LinkedHashMap<Integer, String>();  
  
    static {
        for (ShowType s : EnumSet.allOf(ShowType.class)) {  
        	elMap.put(s.getValue(), s.toString());  
        }
    }
}